#ifndef ASYEDITOR_H
#define ASYEDITOR_H

#include <QMainWindow>
#include <QString>
#include <QPixmap>

#include "ui_asyeditor.h"
#include "asyprocess.h"

class QLabel;
class QCodeEdit;
class QFormatScheme;
class QLanguageFactory;
class AsyEditor :public QMainWindow
{
    Q_OBJECT
public:
    AsyEditor(QWidget *parent=0);
    ~AsyEditor();

private:
    Ui::AsyForm ui;
    QCodeEdit *m_codeedit;
    QFormatScheme *m_format;
    QLanguageFactory *m_language;

    QString lastPath;

    AsyProcess *proc;

    bool needPreview;
    QLabel *prevLabel;
    qreal scaleFactory;
    QPixmap pixmap;


    void save();
    bool isModified();

    void loadConfig();
protected:
	void closeEvent(QCloseEvent *event);

private slots:
	void on_actNew_triggered();
    void on_actOpen_triggered();
    void on_actSave_triggered();
    void on_actExit_triggered();

    void on_actSettings_triggered();

    void on_actPrev_triggered();
    void on_retButton_clicked();
    void on_scaleCombo_currentIndexChanged(int index);

    void sltContentModified(bool);

    void sltProcFinished(int type);
    void sltProcError(QString errinfo);


};

#endif
